// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsISessionStartup.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    /// nsISessionStore keeps track of the current browsing state - i.e.
    /// tab history, cookies, scroll state, form data, and window features
    /// - and allows to restore everything into one window.
    /// </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("934697e4-3807-47f8-b6c9-6caa8d83ccd1")]
	public interface nsISessionStartup
	{
		
		/// <summary>
        /// Return a promise that is resolved once initialization
        /// is complete.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		Gecko.JsVal GetOnceInitializedAttribute();
		
		/// <summary>
        /// Get session state
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		Gecko.JsVal GetStateAttribute();
		
		/// <summary>
        /// Determines whether there is a pending session restore. Should only be
        /// called after initialization has completed.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool DoRestore();
		
		/// <summary>
        /// Determines whether automatic session restoration is enabled for this
        /// launch of the browser. This does not include crash restoration, and will
        /// return false if restoration will only be caused by a crash.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool IsAutomaticRestoreEnabled();
		
		/// <summary>
        /// Returns whether we will restore a session that ends up replacing the
        /// homepage. The browser uses this to not start loading the homepage if
        /// we're going to stop its load anyway shortly after.
        ///
        /// This is meant to be an optimization for the average case that loading the
        /// session file finishes before we may want to start loading the default
        /// homepage. Should this be called before the session file has been read it
        /// will just return false.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetWillOverrideHomepageAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		uint GetSessionTypeAttribute();
		
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetPreviousSessionCrashedAttribute();
	}
	
	/// <summary>nsISessionStartupConsts </summary>
	public class nsISessionStartupConsts
	{
		
		// <summary>
        // What type of session we're restoring.
        // NO_SESSION       There is no data available from the previous session
        // RECOVER_SESSION  The last session crashed. It will either be restored or
        // about:sessionrestore will be shown.
        // RESUME_SESSION   The previous session should be restored at startup
        // DEFER_SESSION    The previous session is fine, but it shouldn't be restored
        // without explicit action (with the exception of pinned tabs)
        // </summary>
		public const ulong NO_SESSION = 0;
		
		// 
		public const ulong RECOVER_SESSION = 1;
		
		// 
		public const ulong RESUME_SESSION = 2;
		
		// 
		public const ulong DEFER_SESSION = 3;
	}
}
